<%
'注册插件
Call RegisterPlugin("CopyToFriends","ActivePlugin_CopyToFriends")
Call Add_Response_Plugin("Response_Plugin_Html_Js_Add","document.write(""<script type=\""text/javascript\"" src=\""" & BlogHost & "zb_users/plugin/copytofriends/ZeroClipboard.js\""></script>"");")

Function ActivePlugin_CopyToFriends()

	Call Add_Filter_Plugin("Filter_Plugin_TArticle_Export_Template","CopyToFriends_SingleInnerCode")

End Function


'文章块模板代码插入
Function CopyToFriends_SingleInnerCode(ByRef html,ByRef SubHtml)

	SubHtml = Replace(SubHtml,"<#article/content#>","<#article/content#>" & CopyToFriends_Code)

End Function

Function CopyToFriends_Code
	Dim innerHtml : innerHtml = ""
	innerHtml = innerHtml & "<div style=""text-align:center;""><input id=""copytofriends"" type=""button""  value=""复制本文链接,推荐给QQ/MSN/GTalk上的好友"" /></div>" & vbCrLf	
    innerHtml = innerHtml & "<script type=""text/javascript"">" & vbCrLf
    innerHtml = innerHtml & "ZeroClipboard.setMoviePath(bloghost+'zb_users/plugin/copytofriends/ZeroClipboard.swf');" & vbCrLf
    innerHtml = innerHtml & "var clip = new ZeroClipboard.Client();" & vbCrLf
    innerHtml = innerHtml & "clip.setHandCursor(true);" & vbCrLf
    innerHtml = innerHtml & "clip.setText(""<#article/title#> <#article/url#>"");" & vbCrLf
    innerHtml = innerHtml & "clip.addEventListener('complete', function(client,text){" & vbCrLf
    innerHtml = innerHtml & "alert(""成功复制本文链接到剪贴板!"");" & vbCrLf
    innerHtml = innerHtml & "});" & vbCrLf
    innerHtml = innerHtml & "clip.glue(""copytofriends"");" & vbCrLf
    innerHtml = innerHtml & "</script>" & vbCrLf
	CopyToFriends_Code = innerHtml
End Function

'安装插件
Function InstallPlugin_CopyToFriends

	Call SetBlogHint(Empty,Empty,True)

End Function

'卸载插件
Function UnInstallPlugin_CopyToFriends

	Call SetBlogHint(Empty,Empty,True)

End Function
%>